package com.cloudwise.util;

import com.cloudwise.entity.User;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

public class MyUtil {
    /**
     * @create by: Teacher陈（86521760@qq.com）
     * @description: 获取当前登录的用户
     * @create time: 2021/12/8 11:10
     * @param
     * @return com.cloudwise.entity.User
     */
    public static User getCurrentUser(){
        Subject subject = SecurityUtils.getSubject();
        Object principal = subject.getPrincipal();
        return (User) principal;
    }
}
